package web.model;

/**
 * Database bean
 * 
 * @author orlin
 */
public abstract class Bean implements Comparable<Bean> {

	private UUID id;

	public Bean() {
		id = new UUID();
	}

	public Bean(UUID id) {
		this.id = id;
	}

	public UUID getId() {
		return id;
	}
	public void setId(UUID id) {
		this.id = id;
	}
	public void setId(String id) {
		this.id = new UUID(id);
	}

	@Override
	public int compareTo(Bean bean) {
		return id.compareTo(bean.getId());
	}
	@Override
	public String toString() {
		return id.toString();
	}
}
